﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;
using TiaoTaoHelper.Wtm.Units.EFCore;

#nullable disable

namespace HengTong.DataAccess.Migrations
{
    /// <inheritdoc />
    public partial class 初始化 : TransactionalMigration
    {
        /// <inheritdoc />
        protected override void UpWithTransaction(MigrationBuilder migrationBuilder)
        {
            // migrationBuilder.EnsureSchema(
            //     name: "Elsa");
            //
            // migrationBuilder.CreateTable(
            //     name: "ActionLogs",
            //     columns: table => new
            //     {
            //         ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
            //         ModuleName = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true),
            //         ActionName = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true),
            //         ITCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
            //         ActionUrl = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: true),
            //         ActionTime = table.Column<DateTime>(type: "datetime2", nullable: false),
            //         Duration = table.Column<double>(type: "float", nullable: false),
            //         Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
            //         IP = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
            //         LogType = table.Column<int>(type: "int", nullable: false),
            //         TenantCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
            //         CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
            //         CreateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
            //         UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
            //         UpdateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true)
            //     },
            //     constraints: table =>
            //     {
            //         table.PrimaryKey("PK_ActionLogs", x => x.ID);
            //     });
            //
            // migrationBuilder.CreateTable(
            //     name: "Bookmarks",
            //     schema: "Elsa",
            //     columns: table => new
            //     {
            //         Id = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: false),
            //         TenantId = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: true),
            //         Hash = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: false),
            //         Model = table.Column<string>(type: "nvarchar(max)", nullable: false),
            //         ModelType = table.Column<string>(type: "nvarchar(max)", nullable: false),
            //         ActivityType = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: false),
            //         ActivityId = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: false),
            //         WorkflowInstanceId = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: false),
            //         CorrelationId = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: false)
            //     },
            //     constraints: table =>
            //     {
            //         table.PrimaryKey("PK_Bookmarks", x => x.Id);
            //     });
            //
            // migrationBuilder.CreateTable(
            //     name: "DataPrivileges",
            //     columns: table => new
            //     {
            //         ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
            //         UserCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
            //         GroupCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
            //         TableName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
            //         RelateId = table.Column<string>(type: "nvarchar(max)", nullable: true),
            //         Domain = table.Column<string>(type: "nvarchar(max)", nullable: true),
            //         TenantCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
            //         CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
            //         CreateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
            //         UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
            //         UpdateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true)
            //     },
            //     constraints: table =>
            //     {
            //         table.PrimaryKey("PK_DataPrivileges", x => x.ID);
            //     });
            //
            // migrationBuilder.CreateTable(
            //     name: "FileAttachments",
            //     columns: table => new
            //     {
            //         ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
            //         FileName = table.Column<string>(type: "nvarchar(max)", nullable: false),
            //         FileExt = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: false),
            //         Path = table.Column<string>(type: "nvarchar(max)", nullable: true),
            //         Length = table.Column<long>(type: "bigint", nullable: false),
            //         UploadTime = table.Column<DateTime>(type: "datetime2", nullable: false),
            //         SaveMode = table.Column<string>(type: "nvarchar(max)", nullable: true),
            //         FileData = table.Column<byte[]>(type: "varbinary(max)", nullable: true),
            //         ExtraInfo = table.Column<string>(type: "nvarchar(max)", nullable: true),
            //         HandlerInfo = table.Column<string>(type: "nvarchar(max)", nullable: true),
            //         TenantCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true)
            //     },
            //     constraints: table =>
            //     {
            //         table.PrimaryKey("PK_FileAttachments", x => x.ID);
            //     });
            //
            // migrationBuilder.CreateTable(
            //     name: "FrameworkGroups",
            //     columns: table => new
            //     {
            //         ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
            //         GroupCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
            //         GroupName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
            //         GroupRemark = table.Column<string>(type: "nvarchar(max)", nullable: true),
            //         Manager = table.Column<string>(type: "nvarchar(max)", nullable: true),
            //         TenantCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
            //         Discriminator = table.Column<string>(type: "nvarchar(21)", maxLength: 21, nullable: false),
            //         IsCompany = table.Column<bool>(type: "bit", nullable: true),
            //         CompanyId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
            //         IsDisabled = table.Column<bool>(type: "bit", nullable: true),
            //         Step = table.Column<int>(type: "int", nullable: true),
            //         ParentId = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
            //     },
            //     constraints: table =>
            //     {
            //         table.PrimaryKey("PK_FrameworkGroups", x => x.ID);
            //         table.ForeignKey(
            //             name: "FK_FrameworkGroups_FrameworkGroups_ParentId",
            //             column: x => x.ParentId,
            //             principalTable: "FrameworkGroups",
            //             principalColumn: "ID");
            //     });
            //
            // migrationBuilder.CreateTable(
            //     name: "FrameworkMenus",
            //     columns: table => new
            //     {
            //         ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
            //         PageName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false),
            //         ActionName = table.Column<string>(type: "nvarchar(max)", nullable: true),
            //         ModuleName = table.Column<string>(type: "nvarchar(max)", nullable: true),
            //         FolderOnly = table.Column<bool>(type: "bit", nullable: false),
            //         IsInherit = table.Column<bool>(type: "bit", nullable: false),
            //         ClassName = table.Column<string>(type: "nvarchar(max)", nullable: true),
            //         MethodName = table.Column<string>(type: "nvarchar(max)", nullable: true),
            //         Domain = table.Column<string>(type: "nvarchar(max)", nullable: true),
            //         ShowOnMenu = table.Column<bool>(type: "bit", nullable: false),
            //         IsPublic = table.Column<bool>(type: "bit", nullable: false),
            //         DisplayOrder = table.Column<int>(type: "int", nullable: false),
            //         IsInside = table.Column<bool>(type: "bit", nullable: false),
            //         TenantAllowed = table.Column<bool>(type: "bit", nullable: true),
            //         Url = table.Column<string>(type: "nvarchar(max)", nullable: true),
            //         Icon = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
            //         ParentId = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
            //     },
            //     constraints: table =>
            //     {
            //         table.PrimaryKey("PK_FrameworkMenus", x => x.ID);
            //         table.ForeignKey(
            //             name: "FK_FrameworkMenus_FrameworkMenus_ParentId",
            //             column: x => x.ParentId,
            //             principalTable: "FrameworkMenus",
            //             principalColumn: "ID");
            //     });
            //
            // migrationBuilder.CreateTable(
            //     name: "FrameworkRoles",
            //     columns: table => new
            //     {
            //         ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
            //         RoleCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
            //         RoleName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
            //         RoleRemark = table.Column<string>(type: "nvarchar(max)", nullable: true),
            //         TenantCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
            //         CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
            //         CreateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
            //         UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
            //         UpdateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true)
            //     },
            //     constraints: table =>
            //     {
            //         table.PrimaryKey("PK_FrameworkRoles", x => x.ID);
            //     });
            //
            // migrationBuilder.CreateTable(
            //     name: "FrameworkTenants",
            //     columns: table => new
            //     {
            //         ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
            //         TCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
            //         TName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
            //         TDb = table.Column<string>(type: "nvarchar(max)", nullable: true),
            //         TDbType = table.Column<int>(type: "int", nullable: true),
            //         DbContext = table.Column<string>(type: "nvarchar(max)", nullable: true),
            //         TDomain = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
            //         TenantCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
            //         EnableSub = table.Column<bool>(type: "bit", nullable: false),
            //         Enabled = table.Column<bool>(type: "bit", nullable: false),
            //         CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
            //         CreateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
            //         UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
            //         UpdateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true)
            //     },
            //     constraints: table =>
            //     {
            //         table.PrimaryKey("PK_FrameworkTenants", x => x.ID);
            //     });
            //
            // migrationBuilder.CreateTable(
            //     name: "FrameworkUserGroups",
            //     columns: table => new
            //     {
            //         ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
            //         UserCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
            //         GroupCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
            //         TenantCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
            //         CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
            //         CreateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
            //         UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
            //         UpdateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true)
            //     },
            //     constraints: table =>
            //     {
            //         table.PrimaryKey("PK_FrameworkUserGroups", x => x.ID);
            //     });
            //
            // migrationBuilder.CreateTable(
            //     name: "FrameworkUserRoles",
            //     columns: table => new
            //     {
            //         ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
            //         UserCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
            //         RoleCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
            //         TenantCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
            //         CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
            //         CreateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
            //         UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
            //         UpdateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true)
            //     },
            //     constraints: table =>
            //     {
            //         table.PrimaryKey("PK_FrameworkUserRoles", x => x.ID);
            //     });
            //
            // migrationBuilder.CreateTable(
            //     name: "FrameworkWorkflows",
            //     columns: table => new
            //     {
            //         ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
            //         UserCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
            //         Tag = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
            //         WorkflowName = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: true),
            //         ModelType = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: true),
            //         ModelID = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
            //         Submitter = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
            //         WorkflowId = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
            //         ActivityId = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
            //         TenantCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
            //         StartTime = table.Column<DateTime>(type: "datetime2", nullable: true)
            //     },
            //     constraints: table =>
            //     {
            //         table.PrimaryKey("PK_FrameworkWorkflows", x => x.ID);
            //     });
            //
            // migrationBuilder.CreateTable(
            //     name: "FunctionPrivileges",
            //     columns: table => new
            //     {
            //         ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
            //         RoleCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
            //         MenuItemId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
            //         Allowed = table.Column<bool>(type: "bit", nullable: false),
            //         TenantCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
            //         CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
            //         CreateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
            //         UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
            //         UpdateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true)
            //     },
            //     constraints: table =>
            //     {
            //         table.PrimaryKey("PK_FunctionPrivileges", x => x.ID);
            //     });
            //
            // migrationBuilder.CreateTable(
            //     name: "Triggers",
            //     schema: "Elsa",
            //     columns: table => new
            //     {
            //         Id = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: false),
            //         TenantId = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: true),
            //         Hash = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: false),
            //         Model = table.Column<string>(type: "nvarchar(max)", nullable: false),
            //         ModelType = table.Column<string>(type: "nvarchar(max)", nullable: false),
            //         ActivityType = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: false),
            //         ActivityId = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: false),
            //         WorkflowDefinitionId = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: false)
            //     },
            //     constraints: table =>
            //     {
            //         table.PrimaryKey("PK_Triggers", x => x.Id);
            //     });
            //
            // migrationBuilder.CreateTable(
            //     name: "WorkflowDefinitions",
            //     schema: "Elsa",
            //     columns: table => new
            //     {
            //         Id = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: false),
            //         DefinitionId = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: false),
            //         TenantId = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: true),
            //         Name = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: true),
            //         DisplayName = table.Column<string>(type: "nvarchar(max)", nullable: true),
            //         Description = table.Column<string>(type: "nvarchar(max)", nullable: true),
            //         Version = table.Column<int>(type: "int", nullable: false),
            //         IsSingleton = table.Column<bool>(type: "bit", nullable: false),
            //         PersistenceBehavior = table.Column<int>(type: "int", nullable: false),
            //         DeleteCompletedInstances = table.Column<bool>(type: "bit", nullable: false),
            //         IsPublished = table.Column<bool>(type: "bit", nullable: false),
            //         IsLatest = table.Column<bool>(type: "bit", nullable: false),
            //         Tag = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: true),
            //         Data = table.Column<string>(type: "nvarchar(max)", nullable: true),
            //         CreatedAt = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false)
            //     },
            //     constraints: table =>
            //     {
            //         table.PrimaryKey("PK_WorkflowDefinitions", x => x.Id);
            //     });
            //
            // migrationBuilder.CreateTable(
            //     name: "WorkflowExecutionLogRecords",
            //     schema: "Elsa",
            //     columns: table => new
            //     {
            //         Id = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: false),
            //         TenantId = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: true),
            //         WorkflowInstanceId = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: false),
            //         ActivityType = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: false),
            //         ActivityId = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: false),
            //         Timestamp = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false),
            //         EventName = table.Column<string>(type: "nvarchar(max)", nullable: true),
            //         Message = table.Column<string>(type: "nvarchar(max)", nullable: true),
            //         Source = table.Column<string>(type: "nvarchar(max)", nullable: true),
            //         Data = table.Column<string>(type: "nvarchar(max)", nullable: true)
            //     },
            //     constraints: table =>
            //     {
            //         table.PrimaryKey("PK_WorkflowExecutionLogRecords", x => x.Id);
            //     });
            //
            // migrationBuilder.CreateTable(
            //     name: "WorkflowInstances",
            //     schema: "Elsa",
            //     columns: table => new
            //     {
            //         Id = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: false),
            //         DefinitionId = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: false),
            //         TenantId = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: true),
            //         Version = table.Column<int>(type: "int", nullable: false),
            //         WorkflowStatus = table.Column<int>(type: "int", nullable: false),
            //         CorrelationId = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: false),
            //         ContextType = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: true),
            //         ContextId = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: true),
            //         Name = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: true),
            //         CreatedAt = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false),
            //         LastExecutedAt = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
            //         FinishedAt = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
            //         CancelledAt = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
            //         FaultedAt = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
            //         Data = table.Column<string>(type: "nvarchar(max)", nullable: true),
            //         LastExecutedActivityId = table.Column<string>(type: "nvarchar(max)", nullable: true),
            //         DefinitionVersionId = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: false)
            //     },
            //     constraints: table =>
            //     {
            //         table.PrimaryKey("PK_WorkflowInstances", x => x.Id);
            //     });
            //
            // migrationBuilder.CreateTable(
            //     name: "FrameworkUsers",
            //     columns: table => new
            //     {
            //         ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
            //         Email = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "邮箱"),
            //         Gender = table.Column<int>(type: "int", nullable: true, comment: "性别"),
            //         CellPhone = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "手机"),
            //         HomePhone = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true, comment: "座机"),
            //         Address = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "地址"),
            //         ZipCode = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "邮编"),
            //         IsAccessInternet = table.Column<bool>(type: "bit", nullable: false),
            //         ErpId = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
            //         CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
            //         CreateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
            //         UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
            //         UpdateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
            //         ITCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
            //         Password = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: false),
            //         Name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
            //         IsValid = table.Column<bool>(type: "bit", nullable: false),
            //         PhotoId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
            //         TenantCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true)
            //     },
            //     constraints: table =>
            //     {
            //         table.PrimaryKey("PK_FrameworkUsers", x => x.ID);
            //         table.ForeignKey(
            //             name: "FK_FrameworkUsers_FileAttachments_PhotoId",
            //             column: x => x.PhotoId,
            //             principalTable: "FileAttachments",
            //             principalColumn: "ID",
            //             onDelete: ReferentialAction.Restrict);
            //     });
            //
            // migrationBuilder.CreateTable(
            //     name: "SysJobPosition",
            //     columns: table => new
            //     {
            //         ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
            //         Code = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
            //         Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
            //         Description = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
            //         GroupId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
            //         Step = table.Column<int>(type: "int", nullable: false),
            //         CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
            //         CreateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
            //         UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
            //         UpdateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true)
            //     },
            //     constraints: table =>
            //     {
            //         table.PrimaryKey("PK_SysJobPosition", x => x.ID);
            //         table.ForeignKey(
            //             name: "FK_SysJobPosition_FrameworkGroups_GroupId",
            //             column: x => x.GroupId,
            //             principalTable: "FrameworkGroups",
            //             principalColumn: "ID");
            //     });
            //
            // migrationBuilder.CreateTable(
            //     name: "SysWechatUser",
            //     columns: table => new
            //     {
            //         ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
            //         WebOpenId = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
            //         MpOpenId = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
            //         MiniProgramOpenId = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
            //         UnionId = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
            //         NickName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
            //         HeadImgUrl = table.Column<string>(type: "nvarchar(1024)", maxLength: 1024, nullable: true),
            //         UserId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
            //         CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
            //         CreateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
            //         UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
            //         UpdateBy = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true)
            //     },
            //     constraints: table =>
            //     {
            //         table.PrimaryKey("PK_SysWechatUser", x => x.ID);
            //         table.ForeignKey(
            //             name: "FK_SysWechatUser_FrameworkUsers_UserId",
            //             column: x => x.UserId,
            //             principalTable: "FrameworkUsers",
            //             principalColumn: "ID");
            //     });
            //
            // migrationBuilder.CreateTable(
            //     name: "SysJobPositionRole",
            //     columns: table => new
            //     {
            //         ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
            //         JobPositionId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
            //         RoleId = table.Column<Guid>(type: "uniqueidentifier", nullable: false)
            //     },
            //     constraints: table =>
            //     {
            //         table.PrimaryKey("PK_SysJobPositionRole", x => x.ID);
            //         table.ForeignKey(
            //             name: "FK_SysJobPositionRole_FrameworkRoles_RoleId",
            //             column: x => x.RoleId,
            //             principalTable: "FrameworkRoles",
            //             principalColumn: "ID",
            //             onDelete: ReferentialAction.Cascade);
            //         table.ForeignKey(
            //             name: "FK_SysJobPositionRole_SysJobPosition_JobPositionId",
            //             column: x => x.JobPositionId,
            //             principalTable: "SysJobPosition",
            //             principalColumn: "ID",
            //             onDelete: ReferentialAction.Cascade);
            //     });
            //
            // migrationBuilder.CreateIndex(
            //     name: "IX_FrameworkGroups_ParentId",
            //     table: "FrameworkGroups",
            //     column: "ParentId");
            //
            // migrationBuilder.CreateIndex(
            //     name: "IX_FrameworkMenus_ParentId",
            //     table: "FrameworkMenus",
            //     column: "ParentId");
            //
            // migrationBuilder.CreateIndex(
            //     name: "IX_FrameworkUsers_PhotoId",
            //     table: "FrameworkUsers",
            //     column: "PhotoId");
            //
            // migrationBuilder.CreateIndex(
            //     name: "IX_SysJobPosition_GroupId",
            //     table: "SysJobPosition",
            //     column: "GroupId");
            //
            // migrationBuilder.CreateIndex(
            //     name: "IX_SysJobPositionRole_JobPositionId",
            //     table: "SysJobPositionRole",
            //     column: "JobPositionId");
            //
            // migrationBuilder.CreateIndex(
            //     name: "IX_SysJobPositionRole_RoleId",
            //     table: "SysJobPositionRole",
            //     column: "RoleId");
            //
            // migrationBuilder.CreateIndex(
            //     name: "IX_SysWechatUser_UnionId",
            //     table: "SysWechatUser",
            //     column: "UnionId",
            //     unique: true,
            //     filter: "UnionId IS NOT NULL");
            //
            // migrationBuilder.CreateIndex(
            //     name: "IX_SysWechatUser_UserId",
            //     table: "SysWechatUser",
            //     column: "UserId");
        }
        
        /// <inheritdoc />
        protected override void DownWithTransaction(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "ActionLogs");

            migrationBuilder.DropTable(
                name: "Bookmarks",
                schema: "Elsa");

            migrationBuilder.DropTable(
                name: "DataPrivileges");

            migrationBuilder.DropTable(
                name: "FrameworkMenus");

            migrationBuilder.DropTable(
                name: "FrameworkTenants");

            migrationBuilder.DropTable(
                name: "FrameworkUserGroups");

            migrationBuilder.DropTable(
                name: "FrameworkUserRoles");

            migrationBuilder.DropTable(
                name: "FrameworkWorkflows");

            migrationBuilder.DropTable(
                name: "FunctionPrivileges");

            migrationBuilder.DropTable(
                name: "SysJobPositionRole");

            migrationBuilder.DropTable(
                name: "SysWechatUser");

            migrationBuilder.DropTable(
                name: "Triggers",
                schema: "Elsa");

            migrationBuilder.DropTable(
                name: "WorkflowDefinitions",
                schema: "Elsa");

            migrationBuilder.DropTable(
                name: "WorkflowExecutionLogRecords",
                schema: "Elsa");

            migrationBuilder.DropTable(
                name: "WorkflowInstances",
                schema: "Elsa");

            migrationBuilder.DropTable(
                name: "FrameworkRoles");

            migrationBuilder.DropTable(
                name: "SysJobPosition");

            migrationBuilder.DropTable(
                name: "FrameworkUsers");

            migrationBuilder.DropTable(
                name: "FrameworkGroups");

            migrationBuilder.DropTable(
                name: "FileAttachments");
        }
    }
}
